package com.project.restaurant.order.feign;

import com.project.restaurant.common.api.ResponseResult;
import com.project.restaurant.thirdpart.dto.LookPayResult;
import com.project.restaurant.thirdpart.dto.WXNativePayOrder;
import com.project.restaurant.common.feign.config.FeignConfig;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.http.MediaType;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;


@FeignClient(value = "third-part",contextId = "third-part.wx.nativePay",path = "/wx/nativePay",configuration = FeignConfig.class)
public interface WXNativePayService {

    @PostMapping(value = "/generate/payUrl",consumes = MediaType.APPLICATION_JSON_VALUE)
    ResponseResult<String> generateNativePayUrl(@RequestBody WXNativePayOrder order);

    @GetMapping(value = "/lookOrder/payState/{orderId}",consumes = MediaType.APPLICATION_JSON_VALUE)
    ResponseResult<LookPayResult> lookOrderPayState(@PathVariable("orderId") String orderId);
}
